// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   treeviewRender.java

package include.treeview;


// Referenced classes of package include.treeview:
//			TreeviewElement

public class treeviewRender
{

	public treeviewRender()
	{
	}

	public static String renderStatic(TreeviewElement treeElmt, boolean bHidden)
	{
		StringBuffer content = new StringBuffer();
		content.append((new StringBuilder("<li id=")).append(treeElmt.getID()).append(">").toString());
		if (treeElmt.canExpand())
			content.append((new StringBuilder("<img src=/images/plus.gif onClick=\"showHide('")).append(treeElmt.getID()).append("')\">").toString());
		else
		if (treeElmt.canExpand())
			content.append((new StringBuilder("<img src=/images/minus.gif onClick=\"showHide('")).append(treeElmt.getID()).append("')\">").toString());
		else
			content.append("<img src=/images/blank.gif>");
		if (treeElmt.canExpand())
			content.append("<a href");
		else
			content.append((new StringBuilder("<img src=/images/folder.gif><a href= ")).append(treeElmt.getNodeUrl()).append(" target=\"mainFrame\"").toString());
		if (treeElmt.canExpand())
			content.append((new StringBuilder("=\"javascript:showHide('")).append(treeElmt.getID()).append("')\"").toString());
		content.append((new StringBuilder(">")).append(treeElmt.getNodeName()).append("</a>").toString());
		if (treeElmt.canExpand())
		{
			content.append("<ul");
			if (!bHidden)
				content.append(" style=\"display:none;white-space: nowrap;TEXT-DECORATION:none\"");
			content.append(">");
			TreeviewElement elmts[] = treeElmt.getChildren();
			for (int i = 0; i < elmts.length; i++)
				content.append(renderStatic(elmts[i], bHidden));

			content.append("</ul>");
		}
		content.append("</li>");
		return content.toString();
	}
}
